import request from "../axios/index";

/*
 * 描述：获取资源及查询
 */
export function getresources(data) {
  return request({
    method: "post",
    url: "/api/manage/resource/get",
    data: data,
  });
}

/*
 * 描述：删除资源
 */
export function delresources(id) {
  return request({
    method: "get",
    url: "/api/manage/resource/delete/" + id,
  });
}

/*
 * 描述：新增资源
 */
export function InseResources(data) {
  return request({
    method: "post",
    url: "/api/manage/resource/save",
    data: data,
    processData: false,
    headers: {
      "Content-Type": "multipart/form-data; boundary=something",
    },
  });
}

/*
 * 描述：修改资源
 */
export function UpdateResources(data) {
  return request({
    method: "post",
    url: "/api/manage/resource/update",
    data: data,
    processData: false,
    headers: {
      "Content-Type": "multipart/form-data; boundary=something",
    },
  });
}

/*
 * 描述：开关状态
 */
export function StatusSwitch(data) {
  return request({
    method: "post",
    url: "/api/manage/resource/statusSwitch",
    data: data,
  });
}